﻿/*****************************************************************//**
 * @file   VAOneXMLAdaptorNoiseControlTreatments.h
 * @brief  VAOne读写声学包适配器
 *
 * @author  lilongyuan (lilongyuan@diso.cn)
 * @date    2025-02-19
 *********************************************************************/
#ifndef VAONEXMLADAPTORNOISECONTROLTREATMENTS_H
#define VAONEXMLADAPTORNOISECONTROLTREATMENTS_H

#include "FITKAbstractVAOneXMLAdaptor.h"

namespace Acoustics
{
    class FITKAcousticsAbsNCT;
    class FITKAcousticsNCTLayUp;
    class FITKAcousticsNCTAbstractLayObj;
    class FITKAcousticsNCTRegularTrimLayer;
    class FITKAcousticsNCTSeptum;
    class FITKAcousticsNCTPerforated;
    class FITKAcousticsNCTResistive;
    class FITKAcousticsNCTUserDefined;
    class FITKAcousticsNCTMultipleNoise;
    class FITKAcousticsNCTMultipleNoiseWeight;
}

namespace IO
{
    /**
     * @brief   VAOne读写声学包适配器
     * @author  lilongyuan (lilongyuan@diso.cn)
     * @date    2025-02-19
     */
    class FITKVAOneXMLIOAPI VAOneXMLAdaptorNoiseControlTreatments : public FITKAbstractVAOneXMLAdaptor
    {
        FITKCLASS(IO, VAOneXMLAdaptorNoiseControlTreatments);
    public:
        /**
         * @brief   构造函数
         * @author  lilongyuan (lilongyuan@diso.cn)
         * @date    2025-02-19
         */
        explicit VAOneXMLAdaptorNoiseControlTreatments() = default;
        /**
         * @brief   析构函数
         * @author  lilongyuan (lilongyuan@diso.cn)
         * @date    2025-02-19
         */
        ~VAOneXMLAdaptorNoiseControlTreatments() = default;
        /**
         * @brief   适配器读数据
         * @return  是否执行成功
         * @author  lilongyuan (lilongyuan@diso.cn)
         * @date    2025-02-19
         */
        bool adaptR() override;
        /**
         * @brief   适配器写数据
         * @return  是否执行成功
         * @author  lilongyuan (lilongyuan@diso.cn)
         * @date    2025-02-19
         */
        bool adaptW() override;
    private:
        /**
         * @brief     读取多层声学包数据
         * @param[i]  node LayeredNoiseControlTreatment节点
         * @return    是否执行成功
         * @author    lilongyuan (lilongyuan@diso.cn)
         * @date      2025-02-24
         */
        bool readLayeredNoiseControlTreatment(rapidxml::xml_node<char>* node);
        /**
         * @brief     读取层信息数据
         * @param[i]  node LayeredNoiseControlTreatment节点，data 多层声学包数据对象
         * @return    是否执行成功
         * @author    lilongyuan (lilongyuan@diso.cn)
         * @date      2025-02-24
         */
        bool readTrimLayer(rapidxml::xml_node<char>* node, Acoustics::FITKAcousticsNCTLayUp* data);
        /**
         * @brief     读取常规板数据
         * @param[i]  node RegularTrimLayer节点，manager 多层声学包管理器
         * @return    是否执行成功
         * @author    lilongyuan (lilongyuan@diso.cn)
         * @date      2025-02-24
         */
        bool readRegularTrimLayer(rapidxml::xml_node<char>* node, Acoustics::FITKAcousticsNCTLayUp* manager);
        /**
         * @brief     读取隔离板数据
         * @param[i]  node SeptumTrimLayer节点，manager 多层声学包管理器
         * @return    是否执行成功
         * @author    lilongyuan (lilongyuan@diso.cn)
         * @date      2025-02-24
         */
        bool readSeptumTrimLayer(rapidxml::xml_node<char>* node, Acoustics::FITKAcousticsNCTLayUp* manager);
        /**
         * @brief     读取多孔介质数据
         * @param[i]  node PerforatedTrimLayer节点，manager 多层声学包管理器
         * @return    是否执行成功
         * @author    lilongyuan (lilongyuan@diso.cn)
         * @date      2025-02-24
         */
        bool readPerforatedTrimLayer(rapidxml::xml_node<char>* node, Acoustics::FITKAcousticsNCTLayUp* manager);
        /**
         * @brief     读取阻尼数据
         * @param[i]  node ResistiveTrimLayer节点，manager 多层声学包管理器
         * @return    是否执行成功
         * @author    lilongyuan (lilongyuan@diso.cn)
         * @date      2025-02-24
         */
        bool readResistiveTrimLayer(rapidxml::xml_node<char>* node, Acoustics::FITKAcousticsNCTLayUp* manager);
        /**
         * @brief     读取多层声学包数据
         * @param[i]  node UserDefinedNoiseControlTreatment节点
         * @return    是否执行成功
         * @author    lilongyuan (lilongyuan@diso.cn)
         * @date      2025-02-24
         */
        bool readUserDefinedNoiseControlTreatment(rapidxml::xml_node<char>* node);
        /**
         * @brief     读取用户自定义声学包属性数据
         * @param[i]  node UserDefinedNoiseControlTreatment节点，data 自定义声学包数据对象
         * @return    是否执行成功
         * @author    lilongyuan (lilongyuan@diso.cn)
         * @date      2025-02-24
         */
        bool readUserDefinedNoiseControlTreatmentAttribute(rapidxml::xml_node<char>* node, Acoustics::FITKAcousticsNCTUserDefined* data);
        /**
         * @brief     读取多重声学包数据
         * @param[i]  node MultipleNoiseControlTreatment节点
         * @return    是否执行成功
         * @author    lilongyuan (lilongyuan@diso.cn)
         * @date      2025-02-24
         */
        bool readMultipleNoiseControlTreatment(rapidxml::xml_node<char>* node);
        /**
         * @brief     读取重信息数据
         * @param[i]  node MultipleNoiseControlTreatment节点，manager 多重声学包管理器
         * @return    是否执行成功
         * @author    lilongyuan (lilongyuan@diso.cn)
         * @date      2025-02-24
         */
        bool readTreatment(rapidxml::xml_node<char>* node, Acoustics::FITKAcousticsNCTMultipleNoise* manager);
    private:
        /**
         * @brief     写出多层声学包数据
         * @param[i]  node LayeredNoiseControlTreatment节点，data 多层声学包数据对象
         * @return    是否执行成功
         * @author    lilongyuan (lilongyuan@diso.cn)
         * @date      2025-02-24
         */
        bool writeLayeredNoiseControlTreatment(rapidxml::xml_node<char>* node, Acoustics::FITKAcousticsNCTLayUp* data);
        /**
         * @brief     写出多层声学包装饰层数据
         * @param[i]  node LayeredNoiseControlTreatment节点，data 多层声学包装饰层数据对象
         * @return    是否执行成功
         * @author    lilongyuan (lilongyuan@diso.cn)
         * @date      2025-02-24
         */
        bool writeTrimLayer(rapidxml::xml_node<char>* node, Acoustics::FITKAcousticsNCTAbstractLayObj* data);
        /**
         * @brief     写出常规板数据
         * @param[i]  node LayeredNoiseControlTreatment节点，data 多层声学包常规板数据对象
         * @return    是否执行成功
         * @author    lilongyuan (lilongyuan@diso.cn)
         * @date      2025-02-24
         */
        bool writeRegularTrimLayer(rapidxml::xml_node<char>* node, Acoustics::FITKAcousticsNCTRegularTrimLayer* data);
        /**
         * @brief     写出隔离板数据
         * @param[i]  node LayeredNoiseControlTreatment节点，data 多层声学包隔离板数据对象
         * @return    是否执行成功
         * @author    lilongyuan (lilongyuan@diso.cn)
         * @date      2025-02-24
         */
        bool writeSeptumTrimLayer(rapidxml::xml_node<char>* node, Acoustics::FITKAcousticsNCTSeptum* data);
        /**
         * @brief     写出多孔介质数据
         * @param[i]  node LayeredNoiseControlTreatment节点，data 多层声学包多孔介质数据对象
         * @return    是否执行成功
         * @author    lilongyuan (lilongyuan@diso.cn)
         * @date      2025-02-24
         */
        bool writePerforatedTrimLayer(rapidxml::xml_node<char>* node, Acoustics::FITKAcousticsNCTPerforated* data);
        /**
         * @brief     写出阻尼数据
         * @param[i]  node LayeredNoiseControlTreatment节点，data 多层声学包阻尼数据对象
         * @return    是否执行成功
         * @author    lilongyuan (lilongyuan@diso.cn)
         * @date      2025-02-24
         */
        bool writeResistiveTrimLayer(rapidxml::xml_node<char>* node, Acoustics::FITKAcousticsNCTResistive* data);
        /**
         * @brief     写出用户自定义声学包数据
         * @param[i]  node UserDefinedNoiseControlTreatment节点，data 自定义声学包数据对象
         * @return    是否执行成功
         * @author    lilongyuan (lilongyuan@diso.cn)
         * @date      2025-02-24
         */
        bool writeUserDefinedNoiseControlTreatment(rapidxml::xml_node<char>* node, Acoustics::FITKAcousticsNCTUserDefined* data);
        /**
         * @brief     写出频谱和单位面积数据
         * @param[i]  node UserDefinedNoiseControlTreatment节点，data 自定义声学包数据对象
         * @return    是否执行成功
         * @author    lilongyuan (lilongyuan@diso.cn)
         * @date      2025-02-24
         */
        bool writeSpectraAndArea(rapidxml::xml_node<char>* node, Acoustics::FITKAcousticsNCTUserDefined* data);
        /**
         * @brief     写出多重声学包数据
         * @param[i]  node MultipleNoiseControlTreatment节点，data 多重声学包数据对象
         * @return    是否执行成功
         * @author    lilongyuan (lilongyuan@diso.cn)
         * @date      2025-02-24
         */
        bool writeMultipleNoiseControlTreatment(rapidxml::xml_node<char>* node, Acoustics::FITKAcousticsNCTMultipleNoise* data);
        /**
         * @brief     写出重信息数据
         * @param[i]  node MultipleNoiseControlTreatment节点，data 多重声学包重信息数据对象
         * @return    是否执行成功
         * @author    lilongyuan (lilongyuan@diso.cn)
         * @date      2025-02-24
         */
        bool writeTreatment(rapidxml::xml_node<char>* node, Acoustics::FITKAcousticsNCTMultipleNoiseWeight* data);
    private:
        /**
         * @brief     读取基础数据
         * @param[i]  node 节点，data 声学包数据对象
         * @return    是否执行成功
         * @author    lilongyuan (lilongyuan@diso.cn)
         * @date      2025-02-24
         */
        bool readBaseAttribute(rapidxml::xml_node<char>* node, Acoustics::FITKAcousticsAbsNCT* data);
        /**
         * @brief     读取颜色数据
         * @param[i]  node 节点，data 声学包数据对象
         * @return    是否执行成功
         * @author    lilongyuan (lilongyuan@diso.cn)
         * @date      2025-02-24
         */
        bool readRGB(rapidxml::xml_node<char>* node, Acoustics::FITKAcousticsAbsNCT* data);
        /**
         * @brief     写出基础数据
         * @param[i]  node 节点，data 声学包数据对象
         * @return    是否执行成功
         * @author    lilongyuan (lilongyuan@diso.cn)
         * @date      2025-02-24
         */
        bool writeBaseAttribute(rapidxml::xml_node<char>* node, Acoustics::FITKAcousticsAbsNCT* data);
        /**
         * @brief     写出颜色数据
         * @param[i]  node 节点，data 声学包数据对象
         * @return    是否执行成功
         * @author    lilongyuan (lilongyuan@diso.cn)
         * @date      2025-02-24
         */
        bool writeRGB(rapidxml::xml_node<char>* node, Acoustics::FITKAcousticsAbsNCT* data);
    };

    Register2FITKIOAdaptorFactory(VAOneXML, NoiseControlTreatments, VAOneXMLAdaptorNoiseControlTreatments)
}

#endif // VAONEXMLADAPTORNOISECONTROLTREATMENTS_H


